import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/manage/article',
    method: 'get',
    params: query
  })
}

export function options() {
  return request({
    url: '/manage/article/create',
    method: 'get'
  })
}

export function fetchArticle() {
  return request({
    url: '/manage/article',
    method: 'get'
  })
}

export function saveArticle(data) {
  return request({
    url: '/manage/article',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/manage/article/' + data.id,
    method: 'post',
    data
  })
}

export function deleteArticle(id, status) {
  return request({
    url: '/manage/article/' + id,
    method: 'delete',
    data: { flag: status }
  })
}

